//
//  SFUserPlaceholderView.swift
//  SeeFM_Swift
//
//  Created by CBCT_MBP on 2021/10/28.
//

import UIKit

class SFUserPlaceholderView: SFUserBaseView {

    override init(frame: CGRect) {
        super.init(frame: frame)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var backBtn: UIButton =  {
        let backBtn = UIButton.init(type: .custom)
        backBtn.setImage(UIImage(named: "icon_mine_nav_back"), for: .normal)
        backBtn.setImage(UIImage(named: "icon_mine_nav_back"), for: .highlighted)
        addSubview(backBtn)
        backBtn.snp.makeConstraints { make in
            make.top.equalTo(self).offset(Adapter.Screen.statusBarHeight)
            make.left.equalToSuperview().offset(13)
            make.width.height.equalTo(44)
        }
        backBtn.isHidden = true
        return backBtn
    }()
    
    lazy var indicator: UIActivityIndicatorView = {
        let indicator = UIActivityIndicatorView.init(style: .gray)
        indicator.startAnimating()
        addSubview(indicator)
        indicator.snp.makeConstraints { make in
            make.center.equalToSuperview()
        }
        return indicator
    }()
    
    override func assembleComponent(info: UserInfo?) {
        
        indicator.isHidden = false
        backBtn.isHidden = coordinator().userVC!.isTabMe
        self.isHidden = info != nil
    }
 
    
}
